<template>
    <div class="users-container">
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="用户管理" name="first">
                <el-table v-if="activeName==='first'"
                    :data="tableData"
                    stripe
                    style="width: 100%">
                        <el-table-column
                        prop="unid" align="center"
                        label="unid"
                        width="180">
                        </el-table-column>
                        <el-table-column
                        prop="username" align="center"
                        label="用户名"
                        width="180">
                        </el-table-column>
                        <el-table-column align="center"
                        prop="nickname"
                        label="昵称">
                        </el-table-column>
                        <el-table-column align="center"
						label="vip等级"
						prop="vipLevel">
                        </el-table-column>
                        <el-table-column label="操作">
                        <el-button type="primary" >编辑</el-button>
                        <el-button type="danger" >删除</el-button>
                        </el-table-column>
                </el-table>
            </el-tab-pane>
            <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
    import * as api from "@/api/users"
    export default{
        meta:{
            title:'yhgl',
            name:'用户管理',
            icon:'iconfont icon-yonghu'
        },
        data () {
            return {
                activeName:'first',
                tableData:[]
            }
        },
        created () {
            api.getAllUsersApi()
            .then(res => {
                console.log(res.data.data);
                this.tableData = res.data.data
            })
        },
        methods: {
			handleClick(tab, event) {
				console.log(tab, event);
			}
		}
    }
</script>